﻿Public Class ucFabricante

    Private fabricanteBO As New fabricanteBO

    Public Property getIdFabricante As Integer
        Get
            Return cmbFabricante.SelectedValue
        End Get
        Set(ByVal value As Integer)
            cmbFabricante.SelectedValue = value
        End Set
    End Property

    Public Property DESCFABRICANTE As String
        Get
            Return cmbFabricante.Text
        End Get
        Set(ByVal value As String)
            cmbFabricante.Text = value
        End Set
    End Property

    Private Sub ucFabricante_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not DesignMode Then
            Try
                cmbFabricante.DisplayMember = "DESC_FABRICANTE"
                cmbFabricante.ValueMember = "ID_FABRICANTE"
                cmbFabricante.DataSource = fabricanteBO.getFabricantes

                If cmbFabricante.Items.Count > 0 Then
                    cmbFabricante.SelectedIndex = 0
                End If
            Catch ex As Exception
                generica.gravaErro(ex)
            End Try
        End If
    End Sub

End Class
